package demo17;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sr=new Scanner(System.in);
        int n=sr.nextInt();
        person[] p=new person[n];
        for (int i = 0; i < p.length; i++) {
            String a=sr.next();
            int b=sr.nextInt();
            boolean c=sr.nextBoolean();
            p[i]=new person(a,b,c);
        }
        for (int i = p.length-1; i >=0; i--) {
            System.out.println(p[i].toString());
        }
        person p1=new person();

        System.out.println(p1.toString());
    }
}
class person{
    private String name;
    private int age;
    private boolean grander;
    private int id;

    public person() {
        System.out.println("This is constructor");
        System.out.println(name+","+age+","+grander+","+id);
    }

    public person(String name, int age, boolean grander) {
        this.name = name;
        this.age = age;
        this.grander = grander;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public boolean isGrander() {
        return grander;
    }

    public void setGrander(boolean grander) {
        this.grander = grander;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Person [name="+name+", age="+age+", gender="+grander+", id="+id+"]";
    }
}
